﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="KCP.aspx.cs" Inherits="QLHD.KCP" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <%--<script language="javascript" type="text/javascript" src="Scripts/ContractManagement.js"></script>--%>
    <script language="javascript" type="text/javascript" src="/Scripts/gridcolumn-control.js"></script>
    <script language="javascript" type="text/javascript" src="/Scripts/kcpGrid.js"></script>
    <script>
        mnggridid = "grid";
        contractpermistion = parseInt('<%=userpermistion %>');
        MaHD = '<%=Request.Params["MaHD"] %>';
    </script>
    <script type="text/x-kendo-template" id="ckptemplate">
        <div class="toolbar">
        <% if(false && !string.IsNullOrEmpty(userpermistion) &&  int.Parse(userpermistion)>=3) {%>
            <div class="function-button">
                <a class="k-button k-button-icontext k-grid-addd" href="javascript:void(0);" onclick="AddEditKCP(null);"><span class="k-icon k-add"></span>Thêm mới KCP</a>
            </div>
            <%} %>
        </div>
         <kendo:grid-column-command>
            <kendo:grid-column-commandItem name="Delete" text="Xóa" click="DeleteKCP"/>
            <kendo:grid-column-commandItem name="Detail" text="Chi tiết" click="ViewDetail"/>
        </kendo:grid-column-command>
    </script>
    <script type="text/javascript" language="javascript">
        $().ready(function () {
            $("#grid").InitialKCPGrid({ contractpermistion: contractpermistion, ckptemplate: $("#ckptemplate") });
        });
        function AddEditKCP(e) {
            var MaKCP = 0;
            if (e != null) {
                e.preventDefault();
                var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
                MaKCP = dataItem.MaKCP;
            }
            var wndwidth = $(window).width();
            var popupwindow = $("#window");
            popupwindow.kendoWindow({
                width: (wndwidth * 0.9) + "px",
                height: "600px",
                title: "Thêm/Sửa Khoán chi phí",
                content: "/KCPPopup.aspx?MaHD=" + MaHD + "&MaKCP=" + MaKCP,
                modal: true,
                animation: false,
                center: true
            });
            popupwindow.data("kendoWindow").open().center();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SidebarContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <h1 class="caption">
        <asp:Literal runat="server" ID="lttitle" Text="DANH SÁCH KHOÁN CHI PHÍ"></asp:Literal></h1>
    <div id="msg">
    </div>
    <div id="details">
    </div>
    <div id="grid">
    </div>
    <div id="window" style="display: none;">
    </div>



</asp:Content>
